package com.hdu.point_offer;

public class lcr139 {
    class Solution {
        public int[] trainingPlan(int[] actions) {
            int l = 0, r = actions.length - 1;
            while (l < r)
            {
                while (l < r && actions[r] % 2 == 1) r--;
                while (l < r && actions[l] % 2 == 0) l++;
                if (l == r) break;
                int temp = actions[l];
                actions[l] = actions[r];
                actions[r] = temp;
            }
            return actions;
        }
    }
}
